Package-level declarations

Types

Link copied to clipboard
fun interface BuildKbJwt
Link copied to clipboard
typealias Claim = Pair<String, JsonElement>

A claim is an attribute of an entity. The claim name, or key, as it would be used in a regular JWT body. The claim value, as it would be used in a regular JWT body. The value MAY be of any type allowed in JSON, including numbers, strings, booleans, arrays, and objects

Link copied to clipboard
fun interface ClaimVisitor

Visitor for selectively disclosed claims.

Link copied to clipboard
fun interface DecoyGen

Generates decoy DisclosureDigest

Link copied to clipboard

Specifies whether something is claim always or Disclosable.Selectively disclosable.

Link copied to clipboard

An array of disclosable claims

Link copied to clipboard
data class DisclosableElement(val disclosable: Disclosable, val element: DisclosableValue)

A disclosable claim (value)

Link copied to clipboard

A disclosable object which contains disclosable claims.

Link copied to clipboard
sealed interface DisclosableValue

Values that can be disclosed:

Link copied to clipboard
sealed interface Disclosure

A combination of a salt, a cleartext claim name, and a cleartext claim value, all of which are used to calculate a digest for the respective claim.

Link copied to clipboard

The digest of a disclosure

Link copied to clipboard

Represents a map which contains all the claims - selectively disclosable or not - found in a SD-JWT. Each entry contains the path and the disclosures required to revel the claim

Link copied to clipboard

Hashing algorithms, used to produce the DisclosureDigest of a Disclosure

Link copied to clipboard
typealias Jwt = String
Link copied to clipboard
typealias JwtAndClaims = Pair<Jwt, JsonObject>

Representation of a JWT both as string and its payload claims

Link copied to clipboard
object JwtBase64
Link copied to clipboard
fun interface JwtSignatureVerifier<out JWT>

An interface that abstracts the verification of JWT signature

Link copied to clipboard
sealed interface KeyBindingError

Errors related to Key Binding

Link copied to clipboard
interface KeyBindingSigner : JWSSigner

Representation of a function used to sign the Keybinding JWT of a Presentation SD-JWT.

Link copied to clipboard
sealed interface KeyBindingVerifier<out JWT>

This represents the two kinds of Key Binding verification

Link copied to clipboard
value class MinimumDigests(val value: Int)
Link copied to clipboard
object NimbusSdJwtOps : SdJwtSerializationOps<SignedJWT> , SdJwtPresentationOps<SignedJWT> , SdJwtVerifier<SignedJWT>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
typealias Salt = String

Salt to be included in a Disclosure claim.

Link copied to clipboard
fun interface SaltProvider

An interface for generating Salt values.

Link copied to clipboard
data class SdJwt<out JWT>(val jwt: JWT, val disclosures: List<Disclosure>)

A parameterized representation of the SD-JWT

Link copied to clipboard
data class SdJwtAndKbJwt<out JWT>(val sdJwt: SdJwt<JWT>, val keyBindingJwt: JWT)

A parameterized representation of a presented SD-JWT with a keyBindingJwt

Link copied to clipboard

The digest of a presentation. It contains the base64-url encoded digest of a presentation with all padding characters removed.

Link copied to clipboard
class SdJwtFactory(hashAlgorithm: HashAlgorithm = HashAlgorithm.SHA_256, saltProvider: SaltProvider = SaltProvider.Default, decoyGen: DecoyGen = DecoyGen.Default, fallbackMinimumDigests: MinimumDigests? = null)

Factory for creating an UnsignedSdJwt

Link copied to clipboard
fun interface SdJwtIssuer<out SIGNED_JWT>

Representation of a function capable of producing an issuance SD-JWT

Link copied to clipboard
fun interface SdJwtRecreateClaimsOps<in JWT>

Operations related to recreating claims

Link copied to clipboard
Link copied to clipboard

An exception carrying a verification error

Link copied to clipboard
interface SdJwtVerifier<JWT>

A single point for verifying SD-JWTs in both SD-JWT and SD-JWT+KB formats, using either compact or JWS JSON serialization.

Link copied to clipboard
typealias SignSdJwt<SIGNED_JWT> = suspend (SdJwt<JsonObject>) -> SdJwt<SIGNED_JWT>

Signs an SD-JWT

Link copied to clipboard
typealias UnsignedSdJwt = SdJwt<JsonObject>
Link copied to clipboard
fun interface UnverifiedIssuanceFrom<out JWT>
Link copied to clipboard
sealed interface VerificationError

Errors that may occur during SD-JWT verification

Functions

Link copied to clipboard
Link copied to clipboard
fun <JWT> SdJwt<JWT>.asJwsJsonObject(option: JwsSerializationOption = JwsSerializationOption.Flattened, kbJwt: Jwt?, getParts: (JWT) -> Triple<String, String, String>): JsonObject
Link copied to clipboard
Link copied to clipboard
inline fun buildDisclosableArray(minimumDigests: Int?, builderAction: DisclosableArraySpecBuilder.() -> Unit): DisclosableArray

A convenient method for building a DisclosableArray given a builderAction

Link copied to clipboard
inline fun buildDisclosableObject(minimumDigests: Int? = null, builderAction: DisclosableObjectSpecBuilder.() -> Unit): DisclosableObject

Factory method for creating a DisclosableObject using the DisclosableObjectSpecBuilder

Link copied to clipboard

Adds the confirmation claim (cnf) as a plain (always disclosable) which contains the jwk

Link copied to clipboard
fun JWTClaimsSet.jsonObject(): JsonObject

An adapter that transforms the payload of a Nimbus JWT to a KotlinX Serialization compatible representation

Link copied to clipboard
Link copied to clipboard
fun KeyBindingVerifier.Companion.mustBePresentAndValid(holderPubKeyExtractor: (JsonObject) -> AsymmetricJWK? = NimbusSdJwtOps.HolderPubKeyInConfirmationClaim, challenge: JsonObject? = null): KeyBindingVerifier.MustBePresentAndValid<SignedJWT>

Factory method for creating a KeyBindingVerifier which applies the rules described in keyBindingJWTProcess.

Link copied to clipboard

The claim name, or key, as it would be used in a regular JWT body

Link copied to clipboard
fun SdJwtIssuer.Companion.nimbus(sdJwtFactory: SdJwtFactory = SdJwtFactory.Default, signer: JWSSigner, signAlgorithm: JWSAlgorithm, jwsHeaderCustomization: JWSHeader.Builder.() -> Unit = fun NimbusJWSHeader.Builder.() { }): SdJwtIssuer<SignedJWT>

Factory method for creating a SdJwtIssuer that uses Nimbus

Link copied to clipboard
fun nimbusToJwtAndClaims(signedJWT: SignedJWT): JwtAndClaims
Link copied to clipboard
fun <JWT> SdJwt<JWT>.recreateClaims(claimsOf: (JWT) -> JsonObject): JsonObject
fun <JWT> SdJwt<JWT>.recreateClaims(visitor: ClaimVisitor? = null, claimsOf: (JWT) -> JsonObject): JsonObject

Recreates the claims, used to produce the SD-JWT That are:

Link copied to clipboard
fun <JWT> SdJwt<JWT>.recreateClaimsAndDisclosuresPerClaim(claimsOf: (JWT) -> JsonObject): Pair<JsonObject, DisclosuresPerClaimPath>

Recreates the claims, used to produce the SD-JWT and at the same time calculates DisclosuresPerClaim

Link copied to clipboard
inline fun sdJwt(minimumDigests: Int? = null, builderAction: DisclosableObjectSpecBuilder.() -> Unit): DisclosableObject

Factory method for creating a DisclosableObject using the DisclosableObjectSpecBuilder

Link copied to clipboard
fun SdJwt<SignedJWT>.serialize(): String

fun <JWT> SdJwt<JWT>.serialize(serializeJwt: (JWT) -> String): String

Serializes an SdJwt in combined format without key binding

Link copied to clipboard
fun SdJwt<SignedJWT>.serializeAsJwsJson(option: JwsSerializationOption = JwsSerializationOption.Flattened): JsonObject
Link copied to clipboard
fun Claim.value(): JsonElement

The claim value, as it would be used in a regular JWT body. The value MAY be of any type allowed in JSON